#ifndef CLIENT_CONTROLLER_H
#define CLIENT_CONTROLLER_H

#include "controller.h"
#include "ClientModel.h"
#include "ClientView.h"
#include "randomnumbergenerator.h"
#include "asteroidfactory.h"
#include "SpaceShipFactory.h"
#include "physics.h"
#include "PhysicsWorld.h"
#include "NetworkPat.h"

const int clientWorldX = WORLD_SIZE_X;
const int clientWorldY = WORLD_SIZE_Y;

class ClientController: public Controller
{
  public:
    ClientController(Model* m, View* v, NetworkPat* net, AsteroidFactory* factory, SpaceShipFactory* sFactory);
    virtual ~ClientController(void);
    virtual void HandleMessages(std::list<Message*>* l);
    virtual GameState Update(void);
    virtual void PassMessage(Message* msg);

  private:
    void ProcessMessages(void);

    ClientView* mView;
    ClientModel* mModel;

    int mBulletLimit;
    bool ShouldCreateAsteroid(float* x, float* y, float* rotation, float* velocity);
    AsteroidFactory* asteroidFactory;
    SpaceShipFactory* sFactory;
    bool ShouldReset;
    PhysicsWorld physics;
    bool firstpass;
    RandomNumberGenerator randNums;
    NetworkPat* _net;
};

#endif
